﻿/**
 * Peter
 * Created by: Peter Development Team
 *    http://peter.codeplex.com/
 * 
 * GNU General Public License version 2 (GPLv2)
 *    http://peter.codeplex.com/license
 *
 *  This code is provided on an AS IS basis, with no WARRANTIES,
 *  CONDITIONS or GUARANTEES of any kind.
 *
 **/

using System.IO;
using Peter.Common;
using Peter.Common.MainMenu;
using Peter.Data;

namespace Peter.Logic
{
   /// <summary>
   /// View model for view an rtf document.
   /// </summary>
   public class ModelRtfViewer : PeterFileDocument
   {
      /// <summary>
      /// Initializes a new rtf viewer model.
      /// </summary>
      public ModelRtfViewer ()
      {
         this.Icon = MainMenuIcon.Document;
      }

      /// <summary>
      /// Opens the given file.
      /// </summary>
      /// <param name="file">File to open.</param>
      public override void Open (FileInfo file)
      {
         this.FileInfo = file;
         this.Title = this.FileInfo.Name;
         this.ToolTip = this.FileInfo.FullName;
         this.ContentId = string.Format ("{0}|{1}", Guids.RTF_EDITOR, this.FileInfo.FullName);
      }
   }
}
